package com.kuang.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class RestFulController01 {
    //映射访问路径
    @RequestMapping("/commit/{p1}/{p2}")
    public String index(@PathVariable int p1,@PathVariable int p2, Model model){
       int result=p1 + p2;
       //springmvc会自动实例化一个Model对象用于向视图中传值
        model.addAttribute("msg","RestFulController01跳转成功！结果wei："+result);
       //返回视图位置
        return "test";
    }
}
